package com.kmist.xiakexing.data;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

import com.kmist.xiakexing.tools.Config;

public class XiakexingDBHelper extends SQLiteOpenHelper {
    public XiakexingDBHelper(@Nullable Context context) {
        super(context, Config.DATABASE_NAME, null, Config.DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql = String.format("create table %s(id integer, pname varchar, name varchar, desc varchar)", Config.TABLE_NAME_MAP);
        db.execSQL(sql);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
